<?php foreach ($menu as $item): ?>
<li>
    <?php if(!empty($item['son'])): ?>
    <!-- 有子菜单 -->
    <a href="#" id="menu_<?=$item['id']?>" class="menu-dropdown">
        <i class="menu-icon <?= $item['icon']?>" aria-hidden="true"></i>
        <span class="menu-text"> <?=Yii::t('menu', $item['name'])?> </span>
        <i class="menu-expand"></i>
    </a>
    <ul class="submenu">
        <?= $this->render('menu', ['menu'=>$item['son']])?>
    </ul>
    <?php else: ?>
    <!-- 无子菜单 -->
    <a  id="item_<?=$item['id']?>" href="<?= $item['route']?>">
        <i class="menu-icon <?= $item['icon']?>" aria-hidden="true"></i>
        <span class="menu-text"> <?=Yii::t('menu', $item['name'])?> </span>
    </a>
    <?php endIf; ?>
</li>
<?php endForeach; ?>